/**
 * 
 */
package fr.fermeManager.library.model.beans;

/**
 * @author Mo
 *
 */
public class TypeTransaction {
	
	private int id;
	
	private boolean actif;
	
	private String libelle;
	
	private Integer idParent;
	
	private String descritption;
	
	private boolean estSortie;
	
	private int level;
	
	public TypeTransaction(boolean estSortieParam) {
		estSortie = estSortieParam;
	}

	/**
	 * @return the idParent
	 */
	public Integer getIdParent() {
		return idParent;
	}

	/**
	 * @param idParent the idParent to set
	 */
	public void setIdParent(Integer idParent) {
		this.idParent = idParent;
	}

	/**
	 * @return the id
	 */
	public int getId() {
		return id;
	}

	/**
	 * @param id the id to set
	 */
	public void setId(int id) {
		this.id = id;
	}

	/**
	 * @return the actif
	 */
	public boolean isActif() {
		return actif;
	}

	/**
	 * @param actif the actif to set
	 */
	public void setActif(boolean actif) {
		this.actif = actif;
	}

	/**
	 * @return the libelle
	 */
	public String getLibelle() {
		return libelle;
	}

	/**
	 * @param libelle the libelle to set
	 */
	public void setLibelle(String libelle) {
		this.libelle = libelle;
	}

	/**
	 * @return the descritption
	 */
	public String getDescritption() {
		return descritption;
	}

	/**
	 * @param descritption the descritption to set
	 */
	public void setDescritption(String descritption) {
		this.descritption = descritption;
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#hashCode()
	 */
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + id;
		return result;
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		TypeTransaction other = (TypeTransaction) obj;
		if (id != other.id)
			return false;
		return true;
	}

	/**
	 * @return the estSortie
	 */
	public boolean isEstSortie() {
		return estSortie;
	}

	/**
	 * @param estSortie the estSortie to set
	 */
	public void setEstSortie(boolean estSortie) {
		this.estSortie = estSortie;
	}

	/**
	 * @return the level
	 */
	public int getLevel() {
		return level;
	}

	/**
	 * @param level the level to set
	 */
	public void setLevel(int level) {
		this.level = level;
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#clone()
	 */
	@Override
	public Object clone() {
		
		TypeTransaction newType = new TypeTransaction(this.estSortie);
		newType.setActif(actif);
		newType.setDescritption(descritption);
		newType.setId(id);
		newType.setIdParent(idParent);
		newType.setLevel(level);
		newType.setLibelle(libelle);
		
		return newType;
	}
	
	
}
